<template>
	<view class="order-list-box">
		<view class="order-list-item" v-for="item in list" :key="item.id">
			<view class="title">商品信息</view>

			<order-goods v-for="goods in item.orderGoods" :key="goods.goods_id" :goods="goods"></order-goods>

			<view class="line">
				<view class="line-left">业务员</view>
				<view class="line-right">{{ item.username }}</view>
			</view>

			<view class="line">
				<view class="line-left">练习电话</view>
				<view class="line-right">{{ item.phone }}</view>
			</view>

			<view class="line">
				<view class="line-left">联系地址</view>
				<view class="line-right">{{ item.province }}</view>
			</view>

			<view class="line">
				<view class="line-left">下单时间</view>
				<view class="line-right">{{ item.createtime }}</view>
			</view>

			<view class="line">
				<view class="line-left">总金额</view>
				<view class="line-right">￥{{ item.money }}</view>
			</view>

			<view class="line">
				<view class="line-left">支付方式</view>
				<view class="line-right">线下</view>
			</view>

			<view class="line">
				<view class="line-left">备注</view>
				<view class="line-right">{{ item.notes }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		const l = [
			{
				"nickname": "王五",
				"username": "李先生",
				"phone": "17837365837",
				"province": "河南省新乡市红旗区西大街79号",
				"address": "测试地址",
				"id": 210,
				"notes": "",
				"payment": "0",
				"createtime": "2024-04-25 10:59:27",
				"money": "600.00",
				"orderGoods": [
					{
						"orderform_id": 210,
						"goods_id": 8,
						"number": 10,
						"giftnumber": 1,
						"moneys": "600.00",
						"id": 8,
						"goods_name": "春日新品",
						"goodsimage": "/uploads/20240418/232098522fd621a44a3df4a9d1cecf54.jpg"
					}
				]
			},
			{
				"nickname": "王五",
				"username": "李先生",
				"phone": "17837365837",
				"province": "河南省新乡市红旗区西大街79号",
				"address": "测试地址",
				"id": 208,
				"notes": "",
				"payment": "0",
				"createtime": "2024-04-25 10:38:28",
				"money": "3060.00",
				"orderGoods": [
					{
						"orderform_id": 208,
						"goods_id": 2,
						"number": 1,
						"giftnumber": 0,
						"moneys": "2000.00",
						"id": 2,
						"goods_name": "黄金手表",
						"goodsimage": "/uploads/20240326/c2cec58ffa266b55496910d6be416875.jpg"
					},
					{
						"orderform_id": 208,
						"goods_id": 3,
						"number": 1,
						"giftnumber": 0,
						"moneys": "1000.00",
						"id": 3,
						"goods_name": "电子手表",
						"goodsimage": "/uploads/20240326/3863568f8c519bf04552bd88e27b9f44.jpg"
					},
					{
						"orderform_id": 208,
						"goods_id": 8,
						"number": 1,
						"giftnumber": 0,
						"moneys": "60.00",
						"id": 8,
						"goods_name": "春日新品",
						"goodsimage": "/uploads/20240418/232098522fd621a44a3df4a9d1cecf54.jpg"
					}
				]
			},
			{
				"nickname": "王五",
				"username": "李先生",
				"phone": "17837365837",
				"province": "河南省新乡市红旗区西大街79号",
				"address": "测试地址",
				"id": 206,
				"notes": "",
				"payment": "0",
				"createtime": "2024-04-25 10:37:58",
				"money": "282.00",
				"orderGoods": [
					{
						"orderform_id": 206,
						"goods_id": 6,
						"number": 1,
						"giftnumber": 0,
						"moneys": "222.00",
						"id": 6,
						"goods_name": "测试test",
						"goodsimage": "/uploads/20240417/05039dc174bac9c077e668a50e70180b.png"
					},
					{
						"orderform_id": 206,
						"goods_id": 8,
						"number": 1,
						"giftnumber": 0,
						"moneys": "60.00",
						"id": 8,
						"goods_name": "春日新品",
						"goodsimage": "/uploads/20240418/232098522fd621a44a3df4a9d1cecf54.jpg"
					}
				]
			}
		]

		return {
			list: l
		};
	},
	onLoad() {
		// this.getOrderList()
	},
	methods: {
		async getOrderList() {
			const res = await uni.$http.post('/api/index/selectOrderform', {
				page: '1'
			});
		}
	}
}
</script>

<style lang="scss">
.order-list-item {
	margin: 28rpx 22rpx;
	background-color: #fff;
	border-radius: 16rpx;
	padding: 28rpx 22rpx;

	.title {
		font-weight: bold;
		font-size: 32rpx;
	}

	.line {
		display: flex;
		justify-content: space-between;
		margin-bottom: 10px;
		font-size: 28rpx;

		.line-left {
			color: #B7BDC4;
		}
	}

}
</style>
